package com.wipz.eoa.iphone.costmanagent.proivderData;

import java.lang.reflect.Field;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.toft.utils.UUIDHexGenerator;
import com.toft.widgets.workflow.utils.DateConvertUtil;
import com.wipz.eoa.iphone.util.Constants;

public class TrifficDetailData {
	private String COSTDATE;
	private String STARTPLACE;
	private String ENDPLACE;
	private String DESCRIBE;
	private String PRICE;
	private String TYPE;
	
	public  Map getTrifficDetailData(HttpServletRequest hp,String[] requparam){
		Field[] fields = this.getClass().getDeclaredFields();
		Map map=new HashMap();
		for (int i = 0; i < fields.length; i++) {
			Field field = fields[i];
			String param=hp.getParameter(field.getName());
			if(param!=null){
				map.put(field.getName(), param);
			}
		}
		map.put("ID", UUIDHexGenerator.getInstance().generate());
		map.put("DETAIL_ID",requparam[1]);
		map.put("REASON", "0");
		map.put("COSTDATE", DateConvertUtil.dateToString(new Date(),"yyyy-MM-dd HH:mm:ss"));
		return map;		
	}
}
